<?php
define('SITE_ROOT','http://localhost:90/ihelp');

require_once (ROOT . DS . 'library' . DS . 'phptal' . DS . 'PHPTAL.php');

// create a new template object
$template = new PHPTAL(VIEW_TEMPLATE_FOLDER . DS . 'stocks' . DS . 'stockmanager.html');

$template->cssRootFolderUrl = SITE_ROOT . DS . "css" . DS;
$template->imgRootFolderUrl = SITE_ROOT . DS . "img" . DS;

$template->stock = $stock;
$template->manager = $manager;

$template->tableName = "V_stock";

$template->set('productName', "product_name" );
$template->set('packageName', "package_name" );
$template->set('metricSystemUnitName', "metric_system_unit_name" );
$template->set('quantity', "quantity" );
$template->set('amountAvailable', "amount_available" );
$template->set('amountDesired', "amount_desired" );
$template->set('onShopList', "on_shoplist" );
$template->set('amountOfCalories', "kCal / 100g" );
$template->set('amountOfNatrium', "natrium / 100g" );
$template->set('productId', "product_id" );
$template->set('packageUnitId', "package_unit_id" );
$template->set('stockId', "stock_id" );
$template->set('metricSystemUnitId', "metric_system_unit_id" );

// execute the template
try {
    echo $template->execute();
}
catch (Exception $e){
    echo $e;
}
?>